<template>
  <van-pull-refresh v-model="loading" success-text="刷新成功" @refresh="onRefresh">
    <slot name="listItem"/>
  </van-pull-refresh>
</template>

<script>

export default {
  name: 'PullRefresh',
  props: {
    value: {
      type: Boolean,
      default: false
    },
    onRefresh: {
      type: Function,
      required: true
    },
    isLoading: {
      type: Boolean,
      required: true
    }
  },
  data() {
    return {
      count: 0,
      testLoading: ''
    }
  },
  computed: {
    loading: {
      get() {
        return this.isLoading
      },
      set(res) {
        this.$emit('update:isLoading', res)
      }
    }
  },
  mounted() {
  },
  methods: {}
}
</script>

<style scoped lang="less">

</style>
